package cpgears.helpers {
	import asunit.framework.TestCase;
	
	/**
	 * ...
	 * @author Whyves
	 */
	public class VersionTest extends TestCase{
		
		private var mVersion:Version = null;
		
		public function VersionTest(testMethod:String = null) {
			super(testMethod);
		}

		override protected function setUp():void {
			mVersion = new Version("5.0.1");
		}
		
		public function testContructor():void {
			var testFunction:Function = function():void { new Version("501") };
			assertThrows(ArgumentError, testFunction);
		}
		
		public function testMajorVersion():void {
			assertEquals(5, mVersion.major);
		}
		
		public function testMinorVersion():void {
			assertEquals(0, mVersion.minor);
		}

		public function testPatchVersion():void {
			assertEquals(1, mVersion.patch);
		}

		public function testToString():void {
			assertEquals("5.0.1", mVersion.toString());
		}
	}

}